import 'dart:ui';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

/**
 * 保持页面状态
 */
class MyAppIndex extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: "Index",
      theme: ThemeData(primarySwatch: Colors.lightBlue),
      home: Index(),
      debugShowCheckedModeBanner: false,
    );
  }
}

class Index extends StatelessWidget {


  @override
  Widget build(BuildContext context) {
    final width = MediaQuery.of(context).size.width;
    final height = MediaQuery.of(context).size.height;

    return Scaffold(
      appBar: AppBar(
        title: Text("sparrow admin"),
      ),
      drawer: LeftListView(),
      body: Row(
        children: [
          Container(
            child: LeftListView(),
            alignment: Alignment.centerLeft,
            width: width/6.5,
            decoration: BoxDecoration(
              border: Border.all(width: 4.0, color: Colors.blue),
            ),
          ),
          Container(
            child: Text("middle"),
              width: width - width / 6.5,
              alignment: Alignment.center,
              decoration: BoxDecoration(
                border: Border.all(width: 4.0, color: Colors.green),
              )
          )
        ],
      ),
    );
  }
}

class LeftListView extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        ListTile(
          title: Text("click 1", style: TextStyle(fontWeight: FontWeight.w500)),
          leading: Icon(
            Icons.account_box,
            color: Colors.lightBlue,
          ),
        ),
        Divider(),
        ListTile(
          title: Text("click 2", style: TextStyle(fontWeight: FontWeight.w500)),
          leading: Icon(
            Icons.account_box,
            color: Colors.lightBlue,
          ),
        ),
        Divider(),
        ListTile(
          title: Text("click 2", style: TextStyle(fontWeight: FontWeight.w500)),
          leading: Icon(
            Icons.account_box,
            color: Colors.lightBlue,
          ),
        ),
        Divider(),
        ListTile(
          title: Text("click 2", style: TextStyle(fontWeight: FontWeight.w500)),
          leading: Icon(
            Icons.account_box,
            color: Colors.lightBlue,
          ),
        ),
        Divider(),
        ListTile(
          title: Text("click 2", style: TextStyle(fontWeight: FontWeight.w500)),
          leading: Icon(
            Icons.account_box,
            color: Colors.lightBlue,
          ),
        ),
        Divider(),
        ListTile(
          title: Text("click 2", style: TextStyle(fontWeight: FontWeight.w500)),
          leading: Icon(
            Icons.account_box,
            color: Colors.lightBlue,
          ),
        ),
        Divider(),
      ],
    );
  }
}
